package com.sc.nft.entity.vo;

import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class DaoSchoolTopHomeArticlePageVO {

    @ApiModelProperty("唯一主键ID")
    private Long id;

    @ApiModelProperty("文章标题")
    private String title;

    @ApiModelProperty("文章封面")
    private String cover;

    @ApiModelProperty("简介")
    private String introduction;

    @ApiModelProperty("观看人数")
    private String watchSum;

    public void setWatchSum(String watchSum) {
        Integer sum = 100000;
        if (Convert.toInt(watchSum) <= sum) {
            this.watchSum = watchSum;
        } else {
            this.watchSum = StrUtil.format("{}w+", Convert.toInt(watchSum)/10000);
        }
    }
}
